﻿<UserControl x:Class="MEFedMVVMDemo.Views.UsersScreen"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:g="http://schemas.galador.net/xaml/libraries"
			 xmlns:models="clr-namespace:MEFedMVVMDemo.ViewModels"
			 xmlns:topns="clr-namespace:MEFedMVVMDemo"
			 mc:Ignorable="d" 
			 d:DesignHeight="300" d:DesignWidth="300"
			 g:Composition.DesignerDataContext="models:TestViewModel"
			 topns:VisualState.Name="{Binding ModelState}"
			 >
	<UserControl.Resources>
		<DataTemplate x:Key="UserTemplate">
			<Grid >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="100"/>
					<ColumnDefinition Width="100"/>
					<ColumnDefinition Width="100"/>
				</Grid.ColumnDefinitions>
				<TextBlock Text="{Binding Name}"/>
				<TextBlock Text="{Binding Surname}" Grid.Column="1"/>
				<TextBlock Text="{Binding Age}" Grid.Column="2"/>
			</Grid >
		</DataTemplate>
	</UserControl.Resources>
	<Grid>
		<ListBox 
			ItemsSource="{Binding Users}" 
			SelectedItem="{Binding SelectedUser, Mode=TwoWay}" 
			ItemTemplate="{StaticResource UserTemplate}" 
			Margin="0,20,0,0"/>
		<TextBlock 
			x:Name="textBlock" 
			HorizontalAlignment="Center" 
			TextWrapping="Wrap" 
			Text="Welcome to MEFedMVVM" 
			VerticalAlignment="Top" 
			Opacity="0" 
			RenderTransformOrigin="0.5,0.5">
			<TextBlock.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform Y="-38"/>
				</TransformGroup>
			</TextBlock.RenderTransform>
		</TextBlock>
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="SomeStates">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:2">
						<VisualTransition.GeneratedEasingFunction>
							<BounceEase EasingMode="EaseOut"/>
						</VisualTransition.GeneratedEasingFunction>
					</VisualTransition>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="Welcome">
					<Storyboard>
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="textBlock">
							<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
						</DoubleAnimationUsingKeyFrames>
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock">
							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="Normal"/>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
	</Grid>
</UserControl>